package com.zb.secure;

import cn.dev33.satoken.secure.SaSecureUtil;

import java.util.UUID;

/**
 * @Author WEN
 * @Date 2023/7/8 0008
 **/
public class BCryptUtil {
    /**
     * 生成盐值
     * @return
     */
    public static String generatorSalt() {
        return SaSecureUtil.sha256(UUID.randomUUID().toString());
    }

    /**
     * 加密密码
     * @param password
     * @param salt
     * @return
     */
    public static String encryPassword(String password, String salt) {
        return SaSecureUtil.sha256(SaSecureUtil.md5BySalt(password, salt));
    }
}
